package com.nineclock.system.feign;

import com.nineclock.common.entity.Result;
import com.nineclock.system.dto.SysCompanyUserDTO;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient("sys-service")
public interface SysCompanyUserFeign {

    @GetMapping("/companyUser/query")
    Result<List<SysCompanyUserDTO>> queryCompanyUser(@RequestParam Long userId, @RequestParam(required = false) Long companyId);

    @ApiOperation(value = "根据员工ID查询企业员工信息")
    @GetMapping("/companyUser/query/{companyUserId}")
    Result<SysCompanyUserDTO> queryCompanyUserById(@PathVariable Long companyUserId);
    /**
     * 查询当前企业所有员工
     */
    @ApiOperation(value = "查询企业所有员工")
    @GetMapping("/companyUser/queryAllUser")
    Result<List<SysCompanyUserDTO>> queryAllUser();

    /**
     * 查询企业所有部门id
     */
    @ApiOperation("查询企业所有部门id")
    @GetMapping("/organization/getAllDepartmentId")
    public Result<List<Long>> getAllDepartmentId();
    /**
     * 根据部门ID集合查询部门下的员工数量
     */
    @ApiOperation("根据部门ID集合查询部门下的员工数量")
    @GetMapping("/organization/getAllUserByDepartmentIdList")
    public Result<Integer> getAllUserByDepartmentIdList(@RequestParam List<Long> departmentIds);
    /**
     * 根据员工ID，依次获取其 所在部门的ID - 所在部门的上级部门的ID - 所在部门的上级部门的上级部门的ID ----> 有序
     */
    @ApiOperation(value="根据员工id获得从低到高级别的部门ID集合")
    @GetMapping("/organization/allDepId/{companyUserId}")
    public Result<List<Long>> getAllDepIdByCompanyUserId(@PathVariable Long companyUserId);
    /**
     * 根据企业ID查询企业的主管理员
     */
    @ApiOperation("根据企业ID查询企业的主管理员")
    @GetMapping("/companyUser/getAdminByCompanyId")
    public Result<SysCompanyUserDTO> getAdminByCompanyId(@RequestParam Long companyId);
    /**
     * 查询某企业的员工列表
     * @param companyId
     * @return
     */
    @ApiOperation(value="查询某企业的员工列表")
    @GetMapping("/companyUser/getAllUserByCompanyId")
    public Result<List<SysCompanyUserDTO>> getAllUserByCompanyId(@RequestParam Long companyId);
}
